<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    //判断数组中是否含有某个成员
    console.log([1, 2, 3].includes('2'));
    //第二个参数表示搜索开始位置
    console.log([1, 2, 3].includes(2, 2));
    const arr = []
    for (const item of [1, 2, 3,1]) {
      if(!arr.includes(item)){
        arr.push(item)
      }
    }
    console.log(arr);
  </script>
</body>

</html>